package com.zwps.biz.controller.http;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zwps.biz.api.model.dto.dsmspgpzwl.*;
import com.zwps.biz.api.model.vo.dsmspgpzwl.DsmHistoryDateVo;
import com.zwps.biz.api.model.vo.dsmspgpzwl.DsmMaxMinVO;
import com.zwps.biz.api.model.vo.dsmspgpzwl.DsmSpgPzwDateVO;
import com.zwps.biz.api.model.vo.dsmspgpzwl.DsmSpgPzwVO;
import com.zwps.biz.domain.service.DsmSpgPzwlService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author dzc
 * @date 2024/9/18 19:59
 * @description
 */


@RestController
@Validated
@RequestMapping("safety/piezometer")
public class DsmSpgPzwlController {
    @Autowired
    private DsmSpgPzwlService dsmSpgPzwlService;


    @Tag(name = "安全监测")
    @PostMapping("Infiltration_line")
    @Operation(summary = "自动监测浸润线数据")
    public List<DsmSpgPzwVO> getPzwl(@Valid @NotNull @RequestBody DsmSpgPzwDTO dspdto){
        return dsmSpgPzwlService.getPzwl(dspdto);
    }


    @Tag(name = "安全监测")
    @PostMapping("manometry_data")
    @Operation(summary = "获取断面测压管数据")
    public PaginatedResult<DsmSpgPzwDateVO> getData(@Valid @NotNull @RequestBody DsmSpgPzwDateDTO dspdto){
        return dsmSpgPzwlService.getData(dspdto);

    }
    @Tag(name = "安全监测")
    @GetMapping("getPzwlList")
    @Operation(summary = "获取全部测压管最新数据")
    public Map<String,Object> getPzwlList(){
        return dsmSpgPzwlService.getPzwlList();
    }
    @Tag(name = "安全监测")
    @PostMapping("maxMin_data")
    @Operation(summary = "最大最小值")
    public DsmMaxMinVO getMaxMin(@Valid @NotNull @RequestBody DsmMaxMinDTO dspdto){
        return dsmSpgPzwlService.getMaxMin(dspdto);
    }

    @Tag(name = "安全监测")
    @PostMapping("history_data")
    @Operation(summary = "测点历史数据")
    public IPage<DsmHistoryDateVo> gethistoryData(@Valid @NotNull @RequestBody DsmHistoryDateDTO historyDateDTO){
        return dsmSpgPzwlService.gethistoryData(historyDateDTO);
    }
}
